home *** CD-ROM | disk | FTP | other *** search
- code segment
-
- assume cs:code,ds:code,es:code,ss:code
-
- org 0
-
-
- laufwerke equ 6
-
- ger_num equ 1
- befehl equ 2
- status equ 3
- anz_ger equ 13
- wechsel equ 14
- end_adr equ 14
- p_adr equ 14
- anz_bef equ 16
- anzahl equ 12h
- bpb_adr equ 12h
- v_adr equ 0fh
- sektor equ 26
- ger_bez equ 22
-
- buf_seg equ 22 ; DualPortedRAM->BufferRAM.PCOffset
-
- bpb_sektoren equ 08h
- bpb_tracks equ 0dh
- bpb_heads equ 0fh
- bpb_secfat equ 0bh
- bpb_secclu equ 02h
- bpb_fats equ 05h
- bpb_medbyte equ 0ah
-
- cmd equ 16384
- arg1 equ cmd+00
- arg2 equ cmd+02
- arg3 equ cmd+04
- arg4 equ cmd+06
- arg5 equ cmd+08
- arg6 equ cmd+0A
- arg7 equ cmd+0C
-
- arg6low equ arg6+1
-
- erst_b equ this byte
-
- dw -1,-1
- dw 0100100000000000b
- dw offset strat
- dw offset intr
- db laufwerke
- db 7 dup (0)
-
- fkt_tab:
- dw offset init
- dw offset med_test
- dw offset get_bpb
- dw offset lesen
- dw offset lesen
- dw offset dummy
- dw offset dummy
- dw offset dummy
- dw offset schreiben
- dw offset schreiben
- dw offset dummy
- dw offset dummy
- dw offset schreiben
- dw offset dummy
- dw offset dummy
- dw offset wechselbar
- dw offset schreiben
-
- db_ptr dw (?),(?)
-
- bpb_ptr:
- dw offset bpb1
- dw offset bpb2
- dw offset bpb3
- dw offset bpb4
- dw offset bpb5
- dw offset bpb6
- janus_seg dw (?)
- janus_ofs dw (?)
-
- bpb1:
- dw 512
- db 2
- dw 1
- db 2
- dw 112
- dw 1440
- db 0F9h
- dw 3
- dw 9
- dw 2
- db 1,0,0,0
-
- bpb2:
- dw 512
- db 2
- dw 1
- db 2
- dw 112
- dw 1440
- db 0F9h
- dw 3
- dw 9
- dw 2
- db 1,0,0,0
-
- bpb3:
- dw 512
- db 2
- dw 1
- db 2
- dw 112
- dw 1440
- db 0F9h
- dw 3
- dw 9
- dw 2
- db 1,0,0,0
-
- bpb4:
- dw 512
- db 2
- dw 1
- db 2
- dw 112
- dw 1440
- db 0F9h
- dw 3
- dw 9
- dw 2
- db 1,0,0,0
-
- bpb5:
- dw 512
- db 2
- dw 1
- db 2
- dw 112
- dw 1440
- db 0F9h
- dw 3
- dw 9
- dw 2
- db 1,0,0,0
-
- bpb6:
- dw 512
- db 2
- dw 1
- db 2
- dw 112
- dw 1440
- db 0F9h
- dw 3
- dw 9
- dw 2
- db 1,0,0,0
-
- vol_name:
- db "DISKTRANS",0,0,0
-
-
- strat proc far
- mov cs:db_ptr,bx
- mov cs:db_ptr+2,es
- ret
- strat endp
-
-
- intr proc far
- pusha
- push es
- push ds
- pushf
-
- push cs
- pop ds
-
- les di,dword ptr db_ptr
- mov bl,es:b[di+befehl]
- cmp bl,anz_bef
- jle bc_okay
- mov ax,8003h
- jmp short intr_end
-
- bc_okay:
- shl bl,1
- xor bh,bh
- call [fkt_tab+bx]
-
- intr_end label near
- push cs
- pop ds
-
- les di,dword ptr db_ptr
- or ax,0100h
- mov es:[di+status],ax
-
- popf
- pop ds
- pop es
- popa
- ret
- intr endp
-
-
- dummy proc near
- xor ax,ax
- ret
- dummy endp
-
-
- med_test proc near
- call near select_device
- cmp ax,0
- jne med_test_fehler
-
- push ds
- mov ds,cs:janus_seg
- mov si,cs:janus_ofs
- mov ds:w[si+arg1],4
- call near call_and_wait
- mov ax,ds:w[si+arg2]
- pop ds
-
- mov es:b[di+wechsel],al
- mov ax,offset vol_name
- mov es:w[di+v_adr],ax
- mov es:w[di+v_adr+2],ds
- xor ax,ax
-
- med_test_fehler:
- ret
- med_test endp
-
-
- get_bpb proc near
- call near select_device
- cmp ax,0
- je yyyy
-
- jmp near get_bpb_fehler
-
- yyyy:
- push ds
- mov ds,cs:janus_seg
- mov si,cs:janus_ofs
- mov ds:w[si+arg1],4
- call near call_and_wait
- mov ax,ds:w[si+arg2]
- pop ds
- cmp al,0ff
- jne xxxx
-
- jmp near get_bpb_fehler
-
- xxxx:
-
- mov si,offset bpb_ptr
- mov bl,es:b[di+ger_num]
- xor bh,bh
- shl bx,1
- add si,bx
- mov si,cs:w[si]
- mov word ptr es:[di+bpb_adr],si
- mov word ptr es:[di+bpb_adr+2],ds
-
- xor ax,ax
- get_bpb_fehler:
- ret
- get_bpb endp
-
-
- wechselbar proc near
- xor ax,ax
- ret
- wechselbar endp
-
-
- schreiben proc near
- push di
- push es
- push ds
-
- call near select_device
- cmp ax,0
- je schreiben_device_okay
- jmp near schreiben_fehler
-
- schreiben_device_okay:
- mov bx,es:w[di+anzahl]
- mov dx,es:w[di+sektor]
- lds si,es:[di+p_adr]
- schreiben_schleife:
- cmp bx,0
- je schreiben_okay
-
- mov bp,bx
- cmp bp,32
- jle schreiben_2
- mov bp,32
-
- schreiben_2:
- push ds
- push si
- push es
- push di
-
- mov es,cs:janus_seg
- mov di,cs:janus_ofs
- mov cx,bp
- shl cx,9
- rep movsb
-
- mov es,cs:janus_seg
- mov di,cs:janus_ofs
- mov es:w[di+arg1],1
- mov es:w[di+arg2],bp
- mov es:w[di+arg3],dx
- call near call_and_wait
- mov cx,es:w[di+arg2]
-
- pop di
- pop es
- pop si
- pop ds
-
- cmp cx,0
- je schreiben_3
- mov ax,cx
- jmp schreiben_fehler
-
- schreiben_3:
- sub bx,bp
- add dx,bp
- mov cx,bp
- shl cx,9
- add si,cx
- jmp schreiben_schleife
-
- schreiben_okay:
- call near motor
- cmp cx,0
- jne schreiben_4
- xor ax,ax
- jmp schreiben_fehler
-
- schreiben_4:
- mov ax,cx
-
- schreiben_fehler:
- pop ds
- pop es
- pop di
- cmp ax,0
- je schreiben_ende
- mov es:w[di+anzahl],0
- schreiben_ende:
- ret
- schreiben endp
-
-
- lesen proc near
- push di
- push es
- push ds
-
- call near select_device
- cmp ax,0
- je lesen_device_okay
- jmp near lesen_fehler
-
- lesen_device_okay:
- mov bx,es:[di+anzahl]
- mov dx,es:[di+sektor]
- les di,es:[di+p_adr]
-
- lese_schleife:
- cmp bx,0
- je lesen_okay
- mov bp,bx
- cmp bp,32
- jle lesen_2
- mov bp,32
-
- lesen_2:
- push ds
- push si
-
- mov ds,cs:janus_seg
- mov si,cs:janus_ofs
- mov ds:w[si+arg1],2
- mov ds:w[si+arg2],bp
- mov ds:w[si+arg3],dx
- call near call_and_wait
- mov cx,ds:w[si+arg2]
-
- pop si
- pop ds
-
- cmp cx,0
- je lesen_3
- mov ax,cx
- jmp lesen_fehler
-
- lesen_3:
- push ds
- push di
- mov ds,cs:janus_seg
- mov si,cs:janus_ofs
- mov cx,bp
- shl cx,9
- rep movsb
- pop di
- pop ds
-
- sub bx,bp
- add dx,bp
- mov cx,bp
- shl cx,9
- add di,cx
- jmp lese_schleife
- lesen_okay:
- call near motor
- cmp cx,0
- jne lesen_4
- xor ax,ax
- jmp lesen_fehler
-
- lesen_4:
- mov ax,cx
-
- lesen_fehler:
- pop ds
- pop es
- pop di
- cmp ax,0
- je lesen_ende
- mov es:w[di+anzahl],0
- lesen_ende:
- ret
- lesen endp
-
-
- motor proc near
- push es
- push di
- mov es,cs:janus_seg
- mov di,cs:janus_ofs
- mov es:w[di+arg1],3
- call near call_and_wait
- mov cx,es:w[di+arg2]
- pop di
- pop es
- ret
- motor endp
-
-
- call_and_wait proc near
- push ax
- mov ah,7
- mov al,29
- int 0b
- mov ah,8
- mov al,29
- int 0b
- pop ax
- ret
- call_and_wait endp
-
-
- select_device proc near
- push ds
- push es
- push si
- push di
- mov ds,cs:janus_seg
- mov si,cs:janus_ofs
- mov ds:w[si+arg1],100
- mov bl,es:b[di+ger_num]
- xor bh,bh
- mov ds:w[si+arg2],bx
- call near call_and_wait
- mov ax,ds:w[si+arg2]
- pop di
- pop si
- pop es
- pop ds
- ret
- select_device endp
-
-
- treiber_ende equ this byte
- ; ------------------ Ende des Treibers --------------------
-
-
- init proc near
- mov ah,30h
- int 21h
- cmp al,3
- jb prinm
-
- mov cs:w[fkt_tab+00],offset dummy
-
- mov al,es:[di+ger_bez]
- add al,"A"
- mov ger_s,al
- add al,laufwerke-1
- mov ger_e,al
-
- prinm:
- mov dx,offset initm
- mov ah,9
- int 21h
-
- push es
- push di
-
- mov ah,1
- mov al,29
- int 0b
- mov janus_ofs,di
- mov janus_seg,es:w[buf_seg]
- mov ax,di
-
- pop di
- pop es
-
- cmp ax,-1
- jne init_weiter
-
- mov dx,offset init_fehler_text
- mov ah,9
- int 21h
-
- mov word ptr es:[di+end_adr],offset erst_b
- mov es:[di+end_adr+2],ds
- mov byte ptr es:[di+anz_ger],0
- mov ax,20
- jmp init_ende
-
- init_weiter:
- mov word ptr es:[di+end_adr],offset treiber_ende
- mov es:[di+end_adr+2],ds
- mov byte ptr es:[di+anz_ger],laufwerke
- mov word ptr es:[di+bpb_adr],offset bpb_ptr
- mov es:w[di+bpb_adr+2],ds
-
- push es
- push di
-
- mov es,cs:janus_seg
- mov di,cs:janus_ofs
- mov es:w[di+arg1],6
- call near call_and_wait
-
- mov cx,0
- Kopiere_BPB:
- mov es,cs:janus_seg
- mov di,cs:janus_ofs
- mov es:w[di+arg1],100
- mov es:w[di+arg2],cx
- call near call_and_wait
- mov es:w[di+arg1],5
- call near call_and_wait
-
- mov bx,es:w[di+arg7]
- cmp bx,1
- jne bx2
- jmp bxokay
-
- bx2:
- cmp bx,2
- jne bxx
-
- ; HD-Laufwerk
-
- jmp bxokay
-
- bxx:
- mov si,offset bpb_ptr
- mov bx,cx
- shl bx,1
- add si,bx
- mov si,ds:w[si]
- mov ds:w[si+bpb_sektoren],es:w[di+arg2]
- mov ds:w[si+bpb_tracks],es:w[di+arg3]
- mov ds:w[si+bpb_heads],es:w[di+arg4]
- mov ds:w[si+bpb_secfat],es:w[di+arg5]
- mov bl,es:b[di+arg6low]
- mov ds:b[si+bpb_secclu],bl
- mov ds:b[si+bpb_fats],1
- mov ds:b[si+bpb_medbyte],0FBH
-
- bxokay:
- add cx,1
- cmp cx,6
- je Kopieren_Fertig
- jmp Kopiere_BPB
-
- Kopieren_Fertig:
- pop di
- pop es
-
- mov dx,offset init_okay_text
- mov ah,9
- int 21h
- xor ax,ax
-
- init_ende:
- ret
- init endp
-
-
- exe_start proc far
- push cs
- pop ds
-
- mov dx,offset exe_text
- mov ah,9
- int 21h
-
- mov ax,4c00
- int 21h
- exe_start endp
-
-
- initm:
- db "ATUtilities Disk Transfer - Version 3.0 2. August 1994",13,10
- db "Copyright (C) 1993-1994 by Thomas Dreibholz. All rights reserved.",13,10,"$"
-
- init_okay_text:
- db "Treiber wurde erfolgreich fr die Laufwerke "
- ger_s db "?"
- db ": bis "
- ger_e db "?"
- db ": installiert.",13,10,10,"$"
-
- init_fehler_text:
- db "Amiga-Handler an Janus-Interrupt 29 ist nicht aktiv!",13,10
- db "Bitte berprfen Sie die Installation der ATUtilities",13,10
- db "Treiber konnte nicht installiert werden.",13,10,10,"$"
-
- exe_text:
- db "ATUtilities Disk Transfer:",13,10
- db "Dieses Programm ist ein Laufwerkstreiber und kann deshalb nicht direkt aufge-",13,10
- db "rufen werden. Um den Treiber zu installieren, muá folgende Zeile in die",13,10
- db "CONFIG.SYS eingefgt werden:",13,10,10
- db "DEVICE=Lw:\Verz\DISK.EXE",13,10,10
- db "Nach dem nchsten Reset stehen dann die neuen Laufwerke zur Verfgung. Bei",13,10
- db "der Installation durch die CONFIG.SYS muá auf dem Amiga das Programm",13,10
- db "Disk Transfer aktiv sein. Zur Vorbereitung und Formatierung und zum Kopieren",13,10
- db "von Disk Transfer-Speichermedien sollte das Programm PREP.EXE benutzt werden.",13,10
- db "Zur Beschleunigung von Zugriffen sollte in der CONFIG.SYS der Eintrag BUFFERS",13,10
- db "auf 15 bis 20 gesetzt werden, oder ein Cache-Programm genutzt werden.",13,10,10,10
- db "17. 09. 1993 - Version 2.0 Copyright (C) 1993 by Thomas Dreibholz",13,10,10,"$"
-
- code ends
- end exe_start
-